package com.example.administrator.daydayappmarket.list.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.ArrayList;
import java.util.List;

/**
 * User: 东哥哥
 * Date: 2016/12/26
 * Time: 12:55
 * Project: DayDayAppMarket
 * Describe：
 */


public class ListFramentPagerAdapter extends FragmentPagerAdapter {

    private List<Fragment> data;

    private String[] titles={"软件榜","游戏榜"};

    public ListFramentPagerAdapter(FragmentManager fm ,List<Fragment> data) {
        super(fm);
        this.data=data;

    }

    @Override
    public Fragment getItem(int position) {
        return data.get(position);
    }

    @Override
    public int getCount() {
        return data!=null?data.size():0;
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return titles[position];
    }
}
